<%@page import="com.pks.insurance.dto.CustomerDto"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<jsp:include page="header.jsp" />
<title>AutoInsurance - Users Administration</title>
<script type="text/javascript" src="template/js/page/adminManage.js"></script>
<link href="template/css/icon.css" rel="stylesheet" type="text/css">
</head>
<body>
	<div id="content-box">
		<div class="border">
			<div class="padding">
				<div class="clr"></div>
				<div id="toolbar-box">
					<div class="t">
						<div class="t">
							<div class="t"></div>
						</div>
					</div>
					<div class="m">
						<div class="toolbar" id="toolbar"></div>
						<div class="header icon-48-user">User Manager</div>

						<div class="clr"></div>
					</div>
					<div class="b">
						<div class="b">
							<div class="b"></div>
						</div>
					</div>
				</div>
				<div class="clr"></div>
				<c:if test="${!empty message}">
					<dl id="system-message">
						<dt class="message">Message</dt>
						<dd class="message message fade">
							<ul>
								<li><c:out value="${message}"/></li>
							</ul>
						</dd>
					</dl>
				</c:if>
				<div id="element-box">
					<div class="t">
						<div class="t">
							<div class="t"></div>
						</div>
					</div>
					<div class="m">
						<form action="admin" method="post" name="adminForm">
							<table>
								<tbody>
									<tr>
										<td width="100%">Filter: <input name="ssn"
											onchange="document.adminForm.submit();" type="text">
											<input type="submit" value="Search" /> <input type="reset"
											value="Reset" /> <input type="hidden" name="task"
											value="search-user" /></td>
									</tr>
								</tbody>
							</table>
						</form>
						<form action="admin" method="post" name="personForm">
							<input type="hidden" name="task" value="edit-user" /> <input
								type="hidden" name="ssn" />
							<table class="adminlist" cellpadding="1">
								<thead>
									<tr>
										<th class="title" width="15%">SSN</th>
										<th class="title">First Name</th>
										<th class="title">Last Name</th>
										<th class="title">Group</th>
										<th class="title">Contact No</th>
										<th class="title">City</th>
										<th class="title">Gender</th>
										<th class="title">E-Mail</th>
										<th class="title">Action</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${customers}" var="customer"
										varStatus="counter">
										<tr class="row${counter.count mod 2 }" id="${customer.ssn }">
											<td><span><c:out value="${customer.ssn }" /> </span></td>
											<td><c:out value="${customer.firstName }" /></td>
											<td><c:out value="${customer.lastName }" /></td>
											<td><c:choose>
													<c:when test="${customer.ssn eq 'adminadmin' }">Administrator</c:when>
													<c:otherwise>User</c:otherwise>
												</c:choose>
											</td>
											<td><c:out value="${customer.mobileNo }" /></td>
											<td><c:out value="${customer.city }" /></td>
											<td><c:out value="${customer.gender }" /></td>
											<td><c:out value="${customer.email}" /></td>
											<td><c:if test="${customer.ssn ne 'adminadmin' }">
													<a onclick="del(this);">Delete</a>
												</c:if></td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</form>
						<div class="clr"></div>
					</div>
					<div class="b">
						<div class="b">
							<div class="b"></div>
						</div>
					</div>
				</div>
				<jsp:include page="footer.jsp" />
			</div>
		</div>
	</div>
</body>
</html>